package org.jmhome.blog.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "BOARD_REPLY")
@NamedQueries({
		@NamedQuery(name = "org.jmhome.blog.model.BoardReply@BoardReplies", query = "from BoardReply as reply where board_seq = :boardSeq order by boardReplySeq desc"),
		@NamedQuery(name = "org.jmhome.blog.model.BoardReply", query = "from BoardReply as reply where boardReplySeq = :boardReplySeq") })
public class BoardReply {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer boardReplySeq;

	@ManyToOne
	@JoinColumn(name = "board_seq")
	private Board board;

	private String writer;

	@Lob
	@Column
	private String content;

	private Date regDate;

	public BoardReply() {
	}

	/**
	 * @param boardReplySeq
	 * @param board
	 * @param writer
	 * @param content
	 * @param regDate
	 */
	public BoardReply(Integer boardReplySeq, Board board, String writer,
			String content, Date regDate) {
		super();
		this.boardReplySeq = boardReplySeq;
		this.board = board;
		this.writer = writer;
		this.content = content;
		this.regDate = regDate;
	}

	/**
	 * @return the boardReplySeq
	 */
	public Integer getBoardReplySeq() {
		return boardReplySeq;
	}

	/**
	 * @param boardReplySeq
	 *            the boardReplySeq to set
	 */
	public void setBoardReplySeq(Integer boardReplySeq) {
		this.boardReplySeq = boardReplySeq;
	}

	/**
	 * @return the board
	 */
	public Board getBoard() {
		return board;
	}

	/**
	 * @param board
	 *            the board to set
	 */
	public void setBoard(Board board) {
		this.board = board;
	}

	/**
	 * @return the writer
	 */
	public String getWriter() {
		return writer;
	}

	/**
	 * @param writer
	 *            the writer to set
	 */
	public void setWriter(String writer) {
		this.writer = writer;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the regDate
	 */
	public Date getRegDate() {
		return regDate;
	}

	/**
	 * @param regDate
	 *            the regDate to set
	 */
	public void setRegDate(Date regDate) {
		this.regDate = regDate;
	}

}
